<template>
  <div>
    这是项目根组件
  </div>
  <RouterLink to="/">首页</RouterLink> |
  <RouterLink to="/about">关于我们</RouterLink> |
  <RouterLink to="/car">购物车</RouterLink>
  <hr>
  <button @click="goCar">购物车2</button>
  <hr>
  <RouterView></RouterView>
</template>

<script setup>
import { useRouter } from 'vue-router';

const router =  useRouter();

const goCar = ()=>{
  router.push("/car");
}
</script>

<style lang="scss" scoped>

</style>